﻿@using System.Web.UI.HtmlControls
@using System.Web.UI.WebControls
@section header{
    <title>导入商品-商品管理</title>
    <link type="text/css" rel="stylesheet" href="/admin_store/css/site.css" />
    <script type="text/javascript" src="/admin_store/scripts/jquery.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/jquery.validate.unobtrusive.js"></script>
    <link type="text/css" rel="stylesheet" href="/components/webuploader/webuploader.css" />
    <script type="text/javascript" src="/components/webuploader/webuploader.js"></script>
    <link type="text/css" href="/components/jbox/Skins/Default/jbox.css" rel="stylesheet" />
    <script type="text/javascript" src="/components/jbox/jquery.jBox-2.3.min.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/selectlist.js"></script>

    <script>
        $(function () {
            var uploader = WebUploader.create({
                pick: '.uploadBut',
                auto: true,
                swf: '/components/webuploader/Uploader.swf',
                server: '/storeadmin/product/importproduct',
                fileVal: 'upload',
                duplicate: true
            });

            uploader.on('uploadProgress', function (file, percentage) {
                $("#mesage").html("上传中...");
            });

            uploader.on('uploadSuccess', function (file, response) {
                var data = response._raw;
                $("#mesage").html(data);

            });

            uploader.on('uploadError', function (file) {
                $("#mesage").html("上传失败");
            });
        });
    </script>
}
@section body{
    <h1 class="rightH1">
        微信小程序 &gt; 商品管理 &gt; <span class="rightH1-cur">导入商品</span>
        <div class="right">
            <a href="@Html.Raw(ViewData["referer"].ToString())" class="menuBT">
                <img src="/admin_store/images/goback.jpg" />返回列表
            </a>
            <div class="clear">
            </div>
        </div>
        <div class="clear">
        </div>
    </h1>
    <div class="addTable" >
        <table width="100%">
            <tbody>

                <tr>
                    <td width="66px" align="right">第一步：</td>
                    <td>
                        <div class="upload">
                            <div class="left">

                                <div class="webuploader-container">
                                    <div class="webuploader-pick">
                                        下载模板
                                    </div>
                                    <div style="position: absolute; top: 0px; left: 0px; width: 102px; height: 42px; overflow: hidden; bottom: auto; right: auto;">
                                        <a href="/admin_store/import/商品导入.xlsx" target="_blank" style="color: white">
                                            <label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);"></label>
                                            
                                        </a>
</div>
                                </div>
                            </div>
                            <div class="clear"></div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="66px" align="right">第二步：</td>
                    <td>
                        <div class="upload">
                            <div class="left">
                                <div class="uploadProgressBar"></div>
                                <div class="uploadBut">上传商品文件</div>
                            </div>
                            <div class="clear"></div>
                        </div>

                    </td>
                </tr>
                <tr>
                    <td width="66px" align="right"></td>
                    <td style="color: red">
                        <span id="mesage"></span>
                    </td>
                </tr>
                <tr>
                    <td width="66px" align="right"></td>
                    <td style="color: chocolate">
                        <p>商品分类必须为系统分类<a href="#" onclick="openCategorySelectLayer(this)">点击查看</a></p>
                        <p>上传过程中请不要关闭本页面</p>
                        <p>导入商品只起到初始化商品基本信息的作用，不会影响已存在的商品</p>
                        <p>商品上传后默认是未上架状态，请完善相关信息后再上架</p>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
}
